package com.mm.girl.util;

import lombok.extern.slf4j.Slf4j;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.io.IOException;

/**
 * @author 港某人
 * @date 2020/8/30 10:48
 */
@Slf4j
public class UrlUtil {

    private static Connection.Response execute;
    private static Document document;

    public static Connection.Response getExecute(String url) {
        try {
            execute = Jsoup.connect(url)
                    .ignoreContentType(true)
                    .ignoreHttpErrors(true)
                    .timeout(3 * 1000)
                    .execute();
        } catch (IOException e) {
            /*e.printStackTrace();*/
            log.info("数据源解析失败 " + url + " " + e.getMessage());
        }
        return execute;
    }
}
